﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace greenwerkz.PlantMonitor
{
    public partial class frmLogin : Form
    {
        public frmLogin()
        {
            InitializeComponent();
        }

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            //validate the user for the grow opp
            greenwerkz.PlantMonitor.patients.patients l_wsPatient = new greenwerkz.PlantMonitor.patients.patients();
            greenwerkz.PlantMonitor.patients.GWpatient l_testLogin = l_wsPatient.loginUser(
                txtUsername.Text,
                txtPassword.Text);
                
            /*
            frmContainer.loginUser l_testLogin = new frmContainer.loginUser(
                txtUsername.Text,
                txtPassword.Text);
             * */
            if (l_testLogin.MemberID  != -1)
            {
                ((frmContainer)this.MdiParent).loginComplete(l_testLogin);
                this.Close();
            }
            else
            {
                MessageBox.Show("Error in username/password, please try again");
            }

        }
    }
}
